package com.thread.test13;

/**
 * @author bin
 * @date 2025 - 03 -14
 **/
public class GirlThread extends Thread{
    private Box box;
    private String name;

    public GirlThread() {
    }

    public GirlThread(Box box, String name) {
        this.box = box;
        this.name = name;
    }

    @Override
    public void run() {
        while(true){
            try {
                box.take(name);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }

}
